package com.lq.ecoldchain.ui.main.message

import com.lq.ecoldchain.base.CommonLoadingViewModel
import com.lq.ecoldchain.ui.main.home.HomeDelegate
import org.kodein.di.Kodein
import org.kodein.di.android.support.AndroidLifecycleScope
import org.kodein.di.generic.bind
import org.kodein.di.generic.instance
import org.kodein.di.generic.scoped
import org.kodein.di.generic.singleton

/*
*2018/12/25 0025  10:10
*function by lq
*/
val messageKodeinModule = Kodein.Module {

    bind<MessageViewModel>() with scoped(AndroidLifecycleScope).singleton {
        MessageViewModel()
    }
    bind<MessageDelegate>() with scoped(AndroidLifecycleScope).singleton {
        MessageDelegate(
                viewModel = instance(),
                loadingViewModel = CommonLoadingViewModel.instance(context)
        )
    }
}